import i18n from '@src/locales';
const rechargeCause = [
  {
    value: 'init',
    label: i18n.t('member.detail.title1')
  },
  {
    value: 'membershipRecharge',
    label: i18n.t('member.detail.title16')
  },
  {
    value: 'refundReturn',
    label: i18n.t('member.detail.title25')
  },
  // {
  //   value: 'serviceFeeExchangeIntegral',
  //   label: '服务费兑换积分'
  // },
]
const consumeCause = [
  // {
  //   value: 'taskConsume',
  //   label: '工单消费'
  // },
  {
    value: 'shopConsume',
    label: i18n.t('member.detail.title2')
  },
  // {
  //   value: 'paasConsume',
  //   label: 'PaaS消费'
  // },
]
const ponitUseColumns = [
  {
      label: i18n.t('member.detail.title3'),
      field: 'createTime',
  }, 
  {
      label: i18n.t('member.detail.title4'),
      field: 'createUserName',
  },
  {
      label: i18n.t('member.components.title34'), 
      field: 'changeCause',
  },
  {
      label: i18n.t('member.detail.title5'),
      field: 'num',
  },
  {
      label: i18n.t('member.components.title40'),  
      field: 'totalRemainder',
  },
]

const ponitChargeColumns = [
  {
      label: i18n.t('member.detail.title6'),
      field: 'createTime',
  }, 
  {
      label: i18n.t('member.detail.title7'),
      field: 'createUserName',
  },
  {
      label: i18n.t('member.components.title34'), 
      field: 'changeCause',
  },
  {
      label: i18n.t('common.member.pointValidityPeriod'), 
      field: 'validateTime',
      minWidth: '150px'
  },
  {
      label: i18n.t('member.detail.title14'),
      field: 'num',
  },
  {
      label: i18n.t('member.components.title40'), 
      field: 'availableNum',
  },
]

// 积分附加组件配置
const pointAddOnConfig = [
  {
      name: i18n.t('member.detail.title9'),
      id: 'pointUseRecord',
      changeCause: [
        ...consumeCause,
        {
          value: 'overdueIntegral',
          label: i18n.t('member.detail.title10'),
        },
        {
          value: 'obsoleteIntegral',
          label: i18n.t('member.components.title37'),
        },
        {
          value: 'usePoints',
          label: i18n.t('member.components.title54'),
        },
        {
          value: 'paasFreezePoints',
          label: i18n.t('member.detail.title32'),
        },
      ],
      columns: ponitUseColumns
  },
  {
    name: i18n.t('member.detail.title11'),
    id: 'pointChargeRecord',
    changeCause: rechargeCause,
    columns: ponitChargeColumns
  }
]

const balanceUseColumns = [
  {
      label: i18n.t('member.detail.title3'),
      field: 'createTime',
  }, 
  {
      label: i18n.t('member.detail.title4'),
      field: 'createUserName',
  },
  {
      label: i18n.t('member.components.title34'), 
      field: 'changeCause',
  },
  {
      label: i18n.t('member.detail.title12'), 
      field: 'num',
  },
  {
      label: i18n.t('member.detail.title13'), 
      field: 'totalRemainder',
  },
]

const balanceChargeColumns = [
  {
      label: i18n.t('member.detail.title6'),
      field: 'createTime',
  }, 
  {
      label: i18n.t('member.detail.title7'),
      field: 'createUserName',
  },
  {
      label: i18n.t('member.components.title34'), 
      field: 'changeCause',
  },
  {
      label: i18n.t('member.detail.title15'),
      field: 'num',
  },
  {
      label: i18n.t('member.detail.title13'),
      field: 'availableNum',
  }
]

// 钱包附加组件配置
const balanceAddOnConfig = [
  {
      name: i18n.t('member.detail.title9'),
      id: 'balanceUseRecord',
      changeCause: [
        ...consumeCause,
        {
          value: 'useBalance',
          label: i18n.t('member.components.title55'),
        },
      ],
      columns: balanceUseColumns
  },
  {
    name: i18n.t('member.detail.title11'),
    id: 'balanceChargeRecord',
    changeCause: [
      {
        value: 'membershipRecharge',
        label: i18n.t('member.detail.title16')
      },
      {
        value: 'init',
        label: i18n.t('member.detail.title1')
      },
      {
        value: 'refundReturn',
        label: i18n.t('member.detail.title25')
      },
    ],
    columns: balanceChargeColumns
  }
]

const serviceFeeUseColumns = [
  {
      label: i18n.t('member.detail.title3'),
      field: 'createTime',
  }, 
  {
      label: i18n.t('member.detail.title4'),
      field: 'createUserName',
  },
  {
      label: i18n.t('member.components.title34'), 
      field: 'changeCause',
  },
  {
      label: i18n.t('member.detail.title17'),
      field: 'num',
  },
  {
      label: i18n.t('member.components.title42'), 
      field: 'totalRemainder',
  },
]

const serviceFeeChargeColumns = [
  {
      label: i18n.t('member.detail.title6'),
      field: 'createTime',
  }, 
  {
      label: i18n.t('member.detail.title7'),
      field: 'createUserName',
  },
  {
      label: i18n.t('member.components.title34'), 
      field: 'changeCause',
  },
  {
      label: i18n.t('common.member.serviceFeeValidityPeriod'), 
      field: 'validateTime',
      minWidth: '150px'
  },
  {
      label: i18n.t('member.detail.title17'),
      field: 'num',
  },
  {
      label: i18n.t('member.components.title42'), 
      field: 'availableNum',
  },
]
// 服务费附加组件配置
const serviceFeeAddOnConfig = [
  {
      name: i18n.t('member.detail.title18'),
      id: 'serviceFeeUseRecord',
      changeCause: [
        ...consumeCause,
        {
          value: 'overdueServiceFee',
          label: i18n.t('member.detail.title19'),
        },
        {
          value: 'obsoleteServiceFee',
          label: i18n.t('member.detail.title20'),
        },
        {
          value: 'serviceFeeExchangeIntegral',
          label: i18n.t('member.detail.title21'),
        }
      ],
      columns: serviceFeeUseColumns
  },
  {
    name: i18n.t('member.detail.title22'),
    id: 'serviceFeeChargeRecord',
    changeCause: [
      {
        value: 'init',
        label: i18n.t('member.detail.title1')
      },
      {
        value: 'membershipRecharge',
        label: i18n.t('member.detail.title16')
      },
      {
        value: 'refundReturn',
        label: i18n.t('member.detail.title25')
      },
    ],
    columns: serviceFeeChargeColumns
  }
]
const limitUseColumns = [
  {
      label: i18n.t('member.detail.title3'),
      field: 'createTime',
  },
  {
    label: i18n.t('member.detail.title4'),
    field: 'changeCause',
  },
  {
      label: i18n.t('member.components.title34'), 
      field: 'changeCause',
  },
  {
      label: i18n.t('member.detail.title23'),
      field: 'num',
  },
  {
      label:i18n.t('member.detail.title24'),
      field: 'availableNum',
  },
]
// 服务费附加组件配置
const limitAddOnConfig = {
      name: i18n.t('member.detail.title23'),
      id: 'serviceFeeUseRecord',
      changeCause: consumeCause,
      columns: limitUseColumns
}
export {
  pointAddOnConfig,
  balanceAddOnConfig,
  serviceFeeAddOnConfig,
  limitAddOnConfig
}